/**
 * 首页模块接口列表
 */

import base from './base'; // 导入接口域名列表
import axios from '@/request/httpRequest'; // 导入http中创建的axios实例
// import qs from 'qs'; // 根据需求是否导入qs模块

const good = {
	//获取商品详情
	getGoodDetail(params) {
		return axios.post(`${base.sq}/client/Products/index?size=M&terminaltype=PC&token=${params.token}`, params.data);
	},
	//加入购物车
	addCarts(params) {
		return axios.post(`${base.sq}/client/ShoppingCarts/addCarts?size=M&terminaltype=PC&token=${params.token}`, { items: JSON.stringify(params.data) });
	},

	//购物车列表
	getCartList(params) {
		return axios.post(`${base.sq}/client/ShoppingCarts/getCartList?size=M&terminaltype=PC&token=${params.token}`, params);
	},
	//添加收藏夹
	addToCollect(params) {
		return axios.post(`${base.sq}/client/ProductFavorites/addProductFavorite?size=M&terminaltype=PC&token=${params.token}`, params.data);
	},
	//取消收藏
	delFavoritesByProductId(params) {
		return axios.post(`${base.sq}/client/ProductFavorites/delFavoritesByProductId?size=M&terminaltype=PC&token=${params.token}`, params.data);
	},
	//购物车删除
	delCarts(params) {
		return axios.post(`${base.sq}/client/ShoppingCarts/del?size=M&terminaltype=PC&token=${params.token}`, params.data);
	},
	//更新购物车
	update(params) {
		return axios.post(`${base.sq}/client/ShoppingCarts/update?size=M&terminaltype=PC&token=${params.token}`, params.data);
	},
	//获取配送方式
	getEMSList(params) {
		return axios.post(`${base.sq}/client/ShoppingCarts/getEMSList?size=M&terminaltype=PC`, params.data);
	},
	//购物车结算
	GenerateOrderByShoppingCart(params) {
		return axios.post(`${base.sq}/client/Orders/GenerateOrderByShoppingCart?size=M&terminaltype=PC&token=${params.token}`, { items: params.data });
	},
	//获取结算订单信息
	getNewOrder(params) {
		return axios.post(`${base.sq}/client/Orders/getNewOrder?size=M&terminaltype=PC&token=${params.token}`, params.data);
	},
	//获取邮费信息

	getPostActivityList(params) {
		return axios.post(`${base.sq}/promotion/PostActivityService/getPostActivityList?size=M&terminaltype=PC&token=${params.token}`, { param: params.data });
	},
	//获取优惠券
	getAvailableCoupon(params) {
		return axios.post(`${base.sq}/coupon/MemberCouponServer/getAvailableCoupon?size=M&terminaltype=PC&token=${params.token}`, params.data);
	},
	//获取退货列表
	getSaleReturnList(params) {
		return axios.post(`${base.sq}/client/SaleReturns/getSaleReturnList?size=M&terminaltype=PC&token=${params.token}`, params.data);
	},
	//退货申请
	saleReturns(params) {
		return axios.post(`${base.sq}/client/SaleReturns/save?size=M&terminaltype=PC&token=${params.token}`, params.data);
	},
	//获取退货详情
	getReturnDetail(params) {
		return axios.post(`${base.sq}/client/Orders/getReturnDetail?size=M&terminaltype=PC&token=${params.token}`, params.data);
	},
	//结算
	submitOrder(params) {
		// return axios.post(`${base.sq}/client/Orders/submitOrder?size=M&terminaltype=PC&token=${params.token}`, params.data);
		return axios.post(`${base.sq}/client/Orders/submitOrder?size=M&terminaltype=PC&token=${params.token}`, { "neworder": params.data });
	},
	//订单流水号
	buildPayment(params) {
		return axios.post(`${base.sq}/client/Pay/buildPayment?size=M&terminaltype=PC&token=${params.token}`, params.data);
	},
	//获取支付参数
	pay(params) {
		return axios.post(`${base.sqq}api/pay/pay`, params);
	},
	//结算前加入购物车(详情立即购买
	orderNow(params) {
		return axios.post(`${base.sq}/client/ShoppingCarts/orderNow?size=M&terminaltype=PC&token=${params.token}`, params.data);
	},
	//结算
	GenerateOrderByShoppingCarts(params) {
		return axios.post(`${base.sq}/client/Orders/GenerateOrderByShoppingCart?size=M&terminaltype=PC&token=${params.token}`, params.data);
	},
	//评价率
	getProductEvaluate(params) {
		return axios.post(`${base.sq}/member/Comments/getProductEvaluate?size=M&terminaltype=PC&token=${params.token}`, params.data);
	},
	//商品评价列表
	query(params) {
		return axios.post(`${base.sq}/member/Comments/query?size=M&terminaltype=PC&token=${params.token}`, params.data);
	},
	//店铺列表
	getShopsByCondition(params) {
		return axios.post(`${base.sq}/client/Shops/getShopsByCondition?size=M&terminaltype=PC&token=${params.token}`, params.data);
	},
	// 获取门店列表orders/getStoreList
	OrderGetStoreList(params) {
		return axios.post(`${base.sq}/client/orders/getStoreList?size=M&terminaltype=PC`, params);
	},
	// 获取搭配套餐promotion/CombinationSalesService/getCombinSaleList
	GetCombinSaleListList(params) {
		return axios.post(`${base.sq}/promotion/CombinationSalesService/getCombinSaleList?size=M&terminaltype=PC&token=${params.token}&iShopId=${params.iShopId}`, params.data);
	},
	// 获取固定套餐  promotion/CombinationSalesService/getFixedSetMenuList
	GetFixedSetMenuListApi(params) {
		return axios.post(`${base.sq}/promotion/CombinationSalesService/getFixedSetMenuList?size=M&terminaltype=PC&token=${params.token}&iShopId=${params.iShopId}`, params.data);
	},
}

export default good;
